
package com.jiuqi.irs.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for billState.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="billStateForm"
 */
public class BillStateForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _bnoGuid = null;
   private java.lang.String _bnoBillNumber = null;
   private java.lang.String _orgCode = null;
   private java.lang.String _bnoBillState = null;
   private java.lang.String _bnoCreatTime = null;
   private java.lang.String _bnoLastTime = null;
   private java.lang.String _bnoYear = null;
   private java.lang.String _reserved1 = null;
   private java.lang.String _reserved2 = null;
   private java.lang.String _reserved3 = null;

   /**
    * Standard constructor.
    */
   public BillStateForm() {
   }

   /**
    * Returns the bnoGuid
    *
    * @return the bnoGuid
    */
   public java.lang.String getBnoGuid() {
      return _bnoGuid;
   }

   /**
    * Sets the bnoGuid
    *
    * @param bnoGuid the new bnoGuid value
    */
   public void setBnoGuid(java.lang.String bnoGuid) {
      _bnoGuid = bnoGuid;
   }
   /**
    * Returns the bnoBillNumber
    *
    * @return the bnoBillNumber
    */
   public java.lang.String getBnoBillNumber() {
      return _bnoBillNumber;
   }

   /**
    * Sets the bnoBillNumber
    *
    * @param bnoBillNumber the new bnoBillNumber value
    */
   public void setBnoBillNumber(java.lang.String bnoBillNumber) {
      _bnoBillNumber = bnoBillNumber;
   }
   /**
    * Returns the orgCode
    *
    * @return the orgCode
    */
   public java.lang.String getOrgCode() {
      return _orgCode;
   }

   /**
    * Sets the orgCode
    *
    * @param orgCode the new orgCode value
    */
   public void setOrgCode(java.lang.String orgCode) {
      _orgCode = orgCode;
   }
   /**
    * Returns the bnoBillState
    *
    * @return the bnoBillState
    */
   public java.lang.String getBnoBillState() {
      return _bnoBillState;
   }

   /**
    * Sets the bnoBillState
    *
    * @param bnoBillState the new bnoBillState value
    */
   public void setBnoBillState(java.lang.String bnoBillState) {
      _bnoBillState = bnoBillState;
   }
   /**
    * Returns the bnoCreatTime
    *
    * @return the bnoCreatTime
    */
   public java.lang.String getBnoCreatTime() {
      return _bnoCreatTime;
   }

   /**
    * Sets the bnoCreatTime
    *
    * @param bnoCreatTime the new bnoCreatTime value
    */
   public void setBnoCreatTime(java.lang.String bnoCreatTime) {
      _bnoCreatTime = bnoCreatTime;
   }
   /**
    * Returns the bnoLastTime
    *
    * @return the bnoLastTime
    */
   public java.lang.String getBnoLastTime() {
      return _bnoLastTime;
   }

   /**
    * Sets the bnoLastTime
    *
    * @param bnoLastTime the new bnoLastTime value
    */
   public void setBnoLastTime(java.lang.String bnoLastTime) {
      _bnoLastTime = bnoLastTime;
   }
   /**
    * Returns the bnoYear
    *
    * @return the bnoYear
    */
   public java.lang.String getBnoYear() {
      return _bnoYear;
   }

   /**
    * Sets the bnoYear
    *
    * @param bnoYear the new bnoYear value
    */
   public void setBnoYear(java.lang.String bnoYear) {
      _bnoYear = bnoYear;
   }
   /**
    * Returns the reserved1
    *
    * @return the reserved1
    */
   public java.lang.String getReserved1() {
      return _reserved1;
   }

   /**
    * Sets the reserved1
    *
    * @param reserved1 the new reserved1 value
    */
   public void setReserved1(java.lang.String reserved1) {
      _reserved1 = reserved1;
   }
   /**
    * Returns the reserved2
    *
    * @return the reserved2
    */
   public java.lang.String getReserved2() {
      return _reserved2;
   }

   /**
    * Sets the reserved2
    *
    * @param reserved2 the new reserved2 value
    */
   public void setReserved2(java.lang.String reserved2) {
      _reserved2 = reserved2;
   }
   /**
    * Returns the reserved3
    *
    * @return the reserved3
    */
   public java.lang.String getReserved3() {
      return _reserved3;
   }

   /**
    * Sets the reserved3
    *
    * @param reserved3 the new reserved3 value
    */
   public void setReserved3(java.lang.String reserved3) {
      _reserved3 = reserved3;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getBnoGuid() == null) {
         errors.add("bnoGuid", new ActionError("error.bnoGuid.required"));
      }
      if(getBnoBillNumber() == null) {
         errors.add("bnoBillNumber", new ActionError("error.bnoBillNumber.required"));
      }
      if(getOrgCode() == null) {
         errors.add("orgCode", new ActionError("error.orgCode.required"));
      }
      if(getBnoYear() == null) {
         errors.add("bnoYear", new ActionError("error.bnoYear.required"));
      }
      // TODO test format/data
      return errors;
   }
}
